<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>房产中介管理系统</title>
<style type="text/css">
body {font-size:9pt;}
</style>
<script type="text/javascript">
Ext.onReady(function(){

	var onValid = function ()
	{
		if (req_name.isValid()
			&& req_telephone.isValid()
			&& house_typedown.isValid()
			&& house_typeup.isValid()
			&& price_down.isValid()
			&& price_up.isValid()
			&& area_down.isValid()
			&& area_up.isValid()
			&& wt_date.isValid())
		{
			SaveButton.enable();
		}
		else
		{
			SaveButton.disable();
		}
	}
	var onInvalid = function ()
	{
		if (req_name.getValue() != ''
			&& req_telephone.getValue() != ''
			&& house_typedown.getValue() != ''
			&& house_typeup.getValue() != ''
			&& price_down.getValue() != ''
			&& price_up.getValue() != ''
			&& area_down.getValue() != ''
			&& area_up.getValue() != ''
			&& Date.parseDate(wt_date.getValue(), 'Y-m-d') != null)
		{
			SaveButton.enable();
		}
		else
		{
			SaveButton.disable();
		}
		//alert(obj.getValue());
		//alert(district3.validate());
	}

	new Ext.form.Form('DialogForm');

	Ext.form.Field.prototype.msgTarget = 'qtip';


    var district1 = new Ext.form.ComboBox({
        transform:'city_zone',
        width:95,
        listWidth:115,
        maxHeight:200,
        editable:false
    });
    district1.on('select',function(){
    		district2_store.removeAll();
    		district3_store.removeAll();
    		if (district1.getValue() != '')
    		{
	    		district2_store.proxy.getConnection().url='<?=site_url()?>/house/manager/getdistrict/'+district1.getValue();
	    		district2_store.load();
	    	}
    		district2.setValue('不限');
    		district3.setValue('不限');
    	}
    );

	var district2_store = new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({url: '<?=site_url()?>/house/manager/getdistrict/'+district1.getValue(), method: 'get'}),
        reader: new Ext.data.XmlReader({record: 'Item',id: 'ID'}, ['ID','NAME'])
	});
	district2_store.on("load",function(obj){obj.insert(0,new Ext.data.Record({ID:'',NAME:'不限'}));});
	var district2 = new Ext.form.ComboBox({
		store: district2_store,
		displayField: 'NAME',
		valueField: 'ID',
		mode: 'local',
		triggerAction: 'all',
        width:95,
        listWidth:115,
        maxHeight:200,
        editable:false
	}).applyTo('region_zone');
    district2.on('select',function(){
			district3_store.removeAll();
    		if (district2.getValue() != '')
    		{
	   			district3_store.proxy.getConnection().url = '<?=site_url()?>/house/manager/getdistrict/' + district2.getValue();
	    		district3_store.load();
    		}
    		district3.setValue('不限');
    	}
    );
	district2.setValue('不限');

	var district3_store = new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({url: '<?=site_url()?>/house/manager/getalldistrict/'+district1.getValue(), method: 'get'}),
        reader: new Ext.data.XmlReader({record: 'Item',id: 'ID'}, ['ID','NAME'])
	});
	district3_store.on("load",function(obj){obj.insert(0,new Ext.data.Record({ID:'',NAME:'不限'}));});
	var district3 = new Ext.form.ComboBox({
		store: district3_store,
		displayField: 'NAME',
		valueField: 'ID',
		mode: 'remote',
		triggerAction: 'all',
        width:107,
        listWidth:127,
        maxHeight:200,
        loadingText:'装载中...',
        editable:false
	}).applyTo('house_zone');
	district3.setValue('不限');


    var req_name = new Ext.form.TextField({
        allowBlank:false,
        blankText:'客户姓名不能为空！',
        width:100
    }).applyTo('req_name');
    req_name.on('invalid',onInvalid);
    req_name.on('valid',onValid);

    var req_telephone = new Ext.form.TextField({
        allowBlank:false,
        blankText:'客户电话不能为空！',
        width:200
    }).applyTo('req_telephone');
    req_telephone.on('invalid',onInvalid);
    req_telephone.on('valid',onValid);

    var req_email = new Ext.form.TextField({
        width:170
    }).applyTo('req_email');

    var link_name = new Ext.form.TextField({
        width:100
    }).applyTo('link_name');
    var link_telephone = new Ext.form.TextField({
        width:200
    }).applyTo('link_telephone');
    var link_email = new Ext.form.TextField({
        width:170
    }).applyTo('link_email');
    var id = new Ext.form.TextField({
        width:100
    }).applyTo('id');
    var req_sort = new Ext.form.ComboBox({
        transform:'req_sort',
        width:82,
        editable:false
    });
    var sex = new Ext.form.ComboBox({
        transform:'sex',
        width:50,
        editable:false
    });
    var req_grade = new Ext.form.ComboBox({
        transform:'req_grade',
        width:50,
        editable:false
    });
    var idcard = new Ext.form.NumberField({
        width:208
    }).applyTo('idcard');
    var req_address = new Ext.form.TextField({
        width:208
    }).applyTo('req_address');
	
	
	// 第二层
	var if_rent1 = new Ext.form.Radio({
		boxLabel:'求租'
	}).applyTo('if_rent1');
	if_rent1.on('check',function(){if_rent1.checked=true;if_rent2.checked=false;Ext.get('price_unit').dom.innerHTML='元';});

	var if_rent2 = new Ext.form.Radio({
		boxLabel:'求购'
	}).applyTo('if_rent2');
	if_rent2.on('check',function(){if_rent1.checked=false;if_rent2.checked=true;Ext.get('price_unit').dom.innerHTML='万';});

    var house_typedown = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'户型下限不能为空！',
        width:50
    }).applyTo('house_typedown');
    house_typedown.on('invalid',onInvalid);
    house_typedown.on('valid',onValid);

    var house_typeup = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'户型上限不能为空！',
        width:50
    }).applyTo('house_typeup');
    house_typeup.on('invalid',onInvalid);
    house_typeup.on('valid',onValid);

    var price_down = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'需求价格下限不能为空！',
        width:50
    }).applyTo('price_down');
    price_down.on('invalid',onInvalid);
    price_down.on('valid',onValid);

    var price_up = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'需求价格上限不能为空！',
        width:50
    }).applyTo('price_up');
    price_up.on('invalid',onInvalid);
    price_up.on('valid',onValid);

    var area_down = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'需求面积下限不能为空！',
        width:50
    }).applyTo('area_down');
    area_down.on('invalid',onInvalid);
    area_down.on('valid',onValid);

    var area_up = new Ext.form.NumberField({
        allowBlank:false,
        blankText:'需求面积上限不能为空！',
        width:50
    }).applyTo('area_up');
    area_up.on('invalid',onInvalid);
    area_up.on('valid',onValid);

    var house_site = new Ext.form.TextField({
        width:124
    }).applyTo('house_site');
    var wt_date = new Ext.form.DateField({
        width:107,
        allowBlank:false,
        blankText:'委托日期不能为空！',
        invalidText:'日期格式错误！正确日期格式为: 四位年-月-日',
        format:'Y-m-d'
    }).applyTo('wt_date');
    wt_date.on('invalid',onInvalid);
    wt_date.on('valid',onValid);

	var ptinfo = new Ext.form.TriggerField({
		width:269,
		onTriggerClick:function(e,obj){ShowMenu(Menu_ptinfo, e, obj);}
	}).applyTo('ptinfo');
	var buildinfo = new Ext.form.TriggerField({
		width:269,
		onTriggerClick:function(e,obj){ShowMenu(Menu_buildinfo, e, obj);}
	}).applyTo('buildinfo');

	ptinfo.getEl().addListener('click', function(e,obj){ShowMenu(Menu_ptinfo, e, obj);});
	buildinfo.getEl().addListener('click', function(e,obj){ShowMenu(Menu_buildinfo, e, obj);});

	// 单击组合框显示复选菜单
	var ShowMenu = function(Menu, e, obj)
	{
		var body = Ext.get(Ext.DomQuery.selectNode('body'));
		var combo = Ext.get(obj);
		var offsetHeight = body.getHeight() - combo.getTop() - Menu.getEl().getHeight();
		var offsetWidth = body.getWidth() - combo.getLeft() - Menu.getEl().getWidth();

		if (offsetHeight>0)
		{
			Menu.showAt(combo.getAlignToXY(obj));
		}
		else
		{
			if (offsetWidth>0) offsetWidth=0;
			Menu.showAt(combo.getAlignToXY(obj,'tl',[offsetWidth,offsetHeight]));
		}
	}


    // 配置
	var Menu_ptinfo = new Ext.menu.Menu();	
	var Menus_ptinfo = Ext.get('menu_ptinfo').query('div');
	Ext.each(Menus_ptinfo, function(obj) {
		Menu_ptinfo.add(new Ext.menu.CheckItem({
				text:(obj.innerText?obj.innerText:obj.textContent),
				checked:(obj.getAttribute('checked')=='checked'),
				checkHandler:Handler_ptinfo
			})
		);
	});
	function Handler_ptinfo()
	{
		var info='';
		Ext.each(Menu_ptinfo.getEl().query('.x-menu-list-item'), function(obj){
			if (Ext.get(obj).hasClass('x-menu-item-checked'))
				info += '-'+(obj.innerText?obj.innerText:obj.textContent)+'-';
		});
		ptinfo.setValue(info);
		ptinfo.getEl().dom.qtip=info;
	}

    // 配置备注
	var Menu_buildinfo = new Ext.menu.Menu();	
	var Menus_buildinfo = Ext.get('menu_buildinfo').query('div');
	Ext.each(Menus_buildinfo, function(obj) {
		Menu_buildinfo.add(new Ext.menu.CheckItem({
				text:(obj.innerText?obj.innerText:obj.textContent),
				checked:(obj.getAttribute('checked')=='checked'),
				checkHandler:Handler_buildinfo
			})
		);
	});
	function Handler_buildinfo()
	{
		var info='';
		Ext.each(Menu_buildinfo.getEl().query('.x-menu-list-item'), function(obj){
			if (Ext.get(obj).hasClass('x-menu-item-checked'))
				info += '-'+(obj.innerText?obj.innerText:obj.textContent)+'-';
		});
		buildinfo.setValue(info);
		buildinfo.getEl().dom.qtip=info;
	}

    var purpose = new Ext.form.ComboBox({
        transform:'purpose',
		listWidth:114,
        width:95,
        editable:false
    });
    var status = new Ext.form.ComboBox({
        transform:'status',
		listWidth:114,
        width:95,
        editable:false
    });
    var house_dir = new Ext.form.ComboBox({
        transform:'house_dir',
		listWidth:114,
        width:95,
        editable:false
    });
    var source = new Ext.form.ComboBox({
        transform:'source',
		listWidth:123,
        width:104,
        editable:false
    });
    var fitment = new Ext.form.ComboBox({
        transform:'fitment',
		listWidth:123,
        width:104,
        editable:false
    });
    var pay_mode = new Ext.form.ComboBox({
        transform:'pay_mode',
		listWidth:123,
        width:104,
        editable:false
    });
    var pay_squeeze = new Ext.form.ComboBox({
        transform:'pay_squeeze',
		listWidth:123,
        width:104,
        editable:false
    });
    var scene = new Ext.form.ComboBox({
        transform:'scene',
		listWidth:123,
        width:104,
        editable:false
    });

	
	// 第三层
    var duty_userid = new Ext.form.ComboBox({
        transform:'duty_userid',
		listWidth:70,
        width:70,
        editable:false
    });
    var kh_secret = new Ext.form.Checkbox({
		boxLabel:'客户保密'
    }).applyTo('kh_secret');
    var ky_secret = new Ext.form.Checkbox({
		boxLabel:'客源保密'
    }).applyTo('ky_secret');
    var kd_secret = new Ext.form.Checkbox({
		boxLabel:'跨店保密'
    }).applyTo('kd_secret');
    var req_memo = new Ext.form.TextArea({
        width:288,
        height:85
    }).applyTo('req_memo');


<?php
// 如果是编辑状态，则初始化所有控件值！
if ($mode=='edit')
{
	$editdata->wt_date = explode(' ', $editdata->wt_date);
	$editdata->wt_date = $editdata->wt_date[0];
?>

	// 第一层
	district1.setValue('<?=$editdata->city_zone_id?>');
	district1.setRawValue('<?=$editdata->city_zone?>');
	district1.fireEvent('select', district1);
	district2.setValue('<?=$editdata->region_zone_id?>');
	district2.setRawValue('<?=$editdata->region_zone?>');
	district2.fireEvent('select', district2);
	district3.setValue('<?=$editdata->house_zone_id?>');
	district3.setRawValue('<?=$editdata->house_zone?>');

    req_name.setValue('<?=$editdata->req_name?>');
    req_telephone.setValue('<?=$editdata->req_telephone?>');
    req_email.setValue('<?=$editdata->req_email?>');
    link_name.setValue('<?=$editdata->link_name?>');
    link_telephone.setValue('<?=$editdata->link_telephone?>');
    link_email.setValue('<?=$editdata->link_email?>');
    id.setValue('<?=$editdata->id?>');
    req_sort.setValue('<?=$editdata->req_sort?>');
    sex.setValue('<?=$editdata->sex?>');
    req_grade.setValue('<?=$editdata->req_grade?>');
    idcard.setValue('<?=$editdata->idcard?>');
    req_address.setValue('<?=$editdata->req_address?>');
	
	// 第二层
	if ('<?=$editdata->if_rent?>' == '求租')
	{
		if_rent1.setValue(true);
		if_rent2.setValue(false);
		if_rent1.fireEvent('check',if_rent1);
	}
	else
	{
		if_rent1.setValue(false);
		if_rent2.setValue(true);
		if_rent2.fireEvent('check',if_rent1);
	}
    house_typedown.setValue('<?=$editdata->house_typedown?>');
    house_typeup.setValue('<?=$editdata->house_typeup?>');
    price_down.setValue('<?=$editdata->price_down?>');
    price_up.setValue('<?=$editdata->price_up?>');
    area_down.setValue('<?=$editdata->area_down?>');
    area_up.setValue('<?=$editdata->area_up?>');
    house_site.setValue('<?=$editdata->house_site?>');
    if (Date.parseDate('<?=$editdata->wt_date?>', 'Y-m-d')!=null)
    {
	    wt_date.setValue('<?=$editdata->wt_date?>');
    }
	ptinfo.setValue('<?=$editdata->ptinfo?>');
	buildinfo.setValue('<?=$editdata->buildinfo?>');
    purpose.setValue('<?=$editdata->purpose?>');
    status.setValue('<?=$editdata->status?>');
    house_dir.setValue('<?=$editdata->house_dir?>');
    source.setValue('<?=$editdata->source?>');
    fitment.setValue('<?=$editdata->fitment?>');
    pay_mode.setValue('<?=$editdata->pay_mode?>');
    pay_squeeze.setValue('<?=$editdata->pay_squeeze?>');
    scene.setValue('<?=$editdata->scene?>');

	// 第三层
    duty_userid.setValue('<?=$editdata->duty_userid?>');
    kh_secret.setValue('<?=$editdata->kh_secret?>');
    ky_secret.setValue('<?=$editdata->ky_secret?>');
    kd_secret.setValue('<?=$editdata->kd_secret?>');
    req_memo.setValue('<?=$editdata->req_memo?>');

<?php
}
?>


	// 删除“装载中...”，显示所有控件！
	Ext.get('load').remove();
	Ext.get('DialogForm').setVisible(true,{duration:.4});
});
</script>
</head>
<body>
<div id="body">
<div id="load" style="padding-left:23px;padding-top:4px;">装载中...</div>
<form id="DialogForm">
  <table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="20">&nbsp;</td>
      <td colspan="5">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="104">&nbsp;</td>
            <td width="192" align="center" class="noblank">手机/电话/小灵通</td>
            <td width="199" align="center">电子邮箱</td>
          </tr>
        </table>
      </td>
      </tr>
    <tr>
      <td width="45" height="25" class="noblank">姓　名:</td>
      <td colspan="5">
        <input name="req_name" id="req_name" size="3" />
        <input name="req_telephone" id="req_telephone" size="3" />
        <input name="req_email" id="req_email" size="3" />
      </td>
      </tr>
    <tr>
      <td height="25">联系人:</td>
      <td colspan="5">
        <input name="link_name" id="link_name" size="3" />
        <input name="link_telephone" id="link_telephone" size="3" />
        <input name="link_email" id="link_email" size="3" />
      </td>
      </tr>
    <tr>
      <td height="25" class="noblank">编　号:</td>
      <td width="108">
        <input name="id" type="text" id="id" size="3" readonly="readonly" />
      </td>
      <td width="35">性别:</td>
      <td width="86">
        <select name="sex" id="sex">
          <?php foreach($sex as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td width="45">身份证:</td>
      <td width="221">
        <input name="idcard" type="text" id="idcard" size="3" />
      </td>
    </tr>
    <tr>
      <td height="25">类　别:</td>
      <td>
        <select name="req_sort" id="req_sort">
          <option value=""></option>
          <?php foreach($req_sort as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td>等级:</td>
      <td>
        <select name="req_grade" id="req_grade">
          <option value=""></option>
          <?php foreach($req_grade as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td>地　址:</td>
      <td>
        <input name="req_address" type="text" id="req_address" size="3" />
      </td>
    </tr>
  </table>
  <hr />
  <table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="25" colspan="2">
        <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
              <input type="radio" name="if_rent" id="if_rent1" value="求租" />
            </td>
            <td>
              <input type="radio" name="if_rent" id="if_rent2" value="求购" checked="checked" />
            </td>
          </tr>
        </table>
        </td>
      <td width="35">用途:</td>
      <td width="130">
        <select name="purpose" id="purpose">
          <?php foreach($purpose as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td width="35">来源:</td>
      <td>
        <select name="source" id="source">
          <option value="不限">不限</option>
          <?php foreach($source as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td width="45" height="25" class="noblank">户　型:</td>
      <td width="160">
        <input name="house_typedown" id="house_typedown" size="3" maxlength="2" />
      至
      <input name="house_typeup" id="house_typeup" size="3" maxlength="2" />
      房</td>
      <td>状态:</td>
      <td>
        <select name="status" id="status">
          <?php foreach($status as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td>装修:</td>
      <td>
        <select name="fitment" id="fitment">
          <option value="不限">不限</option>
          <?php foreach($fitment as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td height="25" class="noblank">价　格:</td>
      <td>
        <input name="price_down" id="price_down" size="3" />
      至
      <input name="price_up" id="price_up" size="3" />
      <span id="price_unit">万</span></td>
      <td>城区:</td>
      <td>
        <select name="city_zone" id="city_zone">
          <option value="不限">不限</option>
          <?php foreach($city_zone as $item):?>
          <option value="<?=$item->ID;?>">
          <?=$item->NAME;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td>付款:</td>
      <td>
        <select name="pay_mode" id="pay_mode">
          <option value="不限">不限</option>
          <?php foreach($pay_mode as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td height="25" class="noblank">面　积:</td>
      <td>
        <input name="area_down" id="area_down" size="3" />
      至  
      <input name="area_up" id="area_up" size="3" />
      ㎡</td>
      <td>片区:</td>
      <td>
        <input name="region_zone" id="region_zone" size="3" />
      </td>
      <td>付佣:</td>
      <td>
        <select name="pay_squeeze" id="pay_squeeze">
          <?php foreach($pay_squeeze as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td height="25">楼　盘:</td>
      <td>
        <input name="house_zone" id="house_zone" size="3" />
      </td>
      <td>朝向:</td>
      <td>
        <select name="house_dir" id="house_dir">
          <option value="不限">不限</option>
          <?php foreach($house_dir as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
      <td>景观:</td>
      <td>
        <select name="scene" id="scene">
          <option value="不限">不限</option>
          <?php foreach($scene as $item):?>
          <option value="<?=$item->TreeView_Name;?>">
          <?=$item->TreeView_Name;?>
          </option>
          <?php endforeach;?>
        </select>
      </td>
    </tr>
    <tr>
      <td height="25">路　街:</td>
      <td>
        <input name="house_site" id="house_site" size="3" />
      </td>
      <td>配置:</td>
      <td colspan="3">
        <input name="ptinfo" type="text" id="ptinfo" size="3" readonly="readonly" />
      </td>
      </tr>
    <tr>
      <td height="25">委托日:</td>
      <td>
        <input name="wt_date" id="wt_date" size="3" value="<?=date('Y-m-d')?>" />
      </td>
      <td>设置:</td>
      <td colspan="3">
        <input name="buildinfo" type="text" id="buildinfo" size="3" readonly="readonly" />
      </td>
      </tr>
  </table>
  <hr />
  <table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="80" height="25" align="center">负责人:</td>
      <td width="125">
        <select name="duty_userid" id="duty_userid">
          <option value="1">admin</option>
        </select>
      </td>
      <td width="35">备注:</td>
      <td rowspan="4" valign="top">
        <textarea name="req_memo" id="req_memo" cols="45" rows="5"></textarea>
      </td>
    </tr>
    <tr>
      <td height="20" colspan="2" align="center">
        <input name="kh_secret" type="checkbox" id="kh_secret" value="1" />
      </td>
      <td>&nbsp;</td>
      </tr>
    <tr>
      <td height="20" colspan="2" align="center">
        <input name="ky_secret" type="checkbox" id="ky_secret" value="1" />
      </td>
      <td>&nbsp;</td>
      </tr>
    <tr>
      <td height="20" colspan="2" align="center">
        <input name="kd_secret" type="checkbox" id="kd_secret" value="1" />
      </td>
      <td>&nbsp;</td>
      </tr>
  </table>
</form>
<div id="menu_ptinfo" class="x-layer">
	<?php foreach($ptinfo as $item):?>
	<?php if (strpos($editdata->ptinfo, '-'.$item->TreeView_Name.'-')!==false): ?>
	<div checked="checked"><?=$item->TreeView_Name;?></div>
	<?php else:?>
	<div><?=$item->TreeView_Name;?></div>
	<?php endif;?>
    <?php endforeach;?>
</div>
<div id="menu_buildinfo" class="x-layer">
	<?php foreach($buildinfo as $item):?>
	<?php if (strpos($editdata->buildinfo, '-'.$item->TreeView_Name.'-')!==false): ?>
	<div checked="checked"><?=$item->TreeView_Name;?></div>
	<?php else:?>
	<div><?=$item->TreeView_Name;?></div>
	<?php endif;?>
    <?php endforeach;?>
</div>
</div>
</body>
</html>
